import pygame, sys
from pygame.locals import *

# set up pygame
pygame.init()

S_WIDTH = 240
S_HEIGHT = 320

# set up the window
windowSurface = pygame.display.set_mode((S_WIDTH, S_HEIGHT), 0, 32)
pygame.display.set_caption('ch2_6')

BLACK = (0, 0, 0)

bg = pygame.Rect(0, 0, S_WIDTH, S_HEIGHT)
bgImage = pygame.image.load('\\game\\cebg.bmp')

DRA_WIDTH = 85
DRA_HEIGHT = 99

dragon = pygame.Rect(100, 200, DRA_WIDTH, DRA_HEIGHT)
dragonImage = pygame.image.load('\\game\\dra.bmp')

while True:
    for event in pygame.event.get():
        if event.type == QUIT or event.type == KEYDOWN:
            pygame.quit()
            sys.exit()

    windowSurface.fill(BLACK)
    windowSurface.blit(bgImage, bg)
    windowSurface.blit(dragonImage, dragon, (DRA_WIDTH, 0, DRA_WIDTH, DRA_HEIGHT), BLEND_MIN)
    windowSurface.blit(dragonImage, dragon, (0, 0, DRA_WIDTH, DRA_HEIGHT), BLEND_MAX)
    pygame.display.update()
